﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 备忘录模式
{
    /// <summary>
    /// 1 undo和redo：备忘模式和命令模式的区别
    /// 2 备忘录模式(Memento Patern)，一次恢复和多次恢复
    /// </summary>
    class Program
    {
        static void Main(string[] args)
        {
            //List<War3> war3List = new List<War3>();
            War3 war3 = new War3()
            {
                Race = "Undead",
                Hero = "Level 1 Dk",
                Army = "5只食尸鬼",
                Resource = "200G 200W"
            };
            //war3List.Add(war3);
            war3.Save("Start");
            war3.Show();

            Console.WriteLine("*******MF*******");
            war3.Hero = "3级DK1级Lich";
            war3.Army = "5只蜘蛛2只食尸鬼";
            war3.Resource = "500G 300W";
            //war3List.Add(war3);
            war3.Save("MF");
            //war3.Lond();
            war3.Show();

            Console.WriteLine("*******交战*******");
            war3.Hero = "4级DK 3级Lich 1级小强";
            war3.Army = "1只憎恶6只蜘蛛1只雕像";
            war3.Resource = "1000G 1500W";
            war3.Save("交战");
            Console.WriteLine("*****决战*******");
            war3.Hero = "5级DK 4级Lich 3级小强";
            war3.Army = "2只憎恶8只蜘蛛2只雕像";
            war3.Resource = "1000G 1500W";
            war3.Save("决战");

            Console.WriteLine("*****决战后*******");
            war3.Hero = "6级DK 6级Lich 3级小强";
            war3.Army = "1只憎恶2只蜘蛛1只冰龙";
            war3.Resource = "10G 1200W";
            war3.Save("决战后");
            //war3.Load();
            war3.Load("Start");
            war3.Show();
            war3.Load("MF");
            war3.Show();
            war3.Load("交战");
            war3.Show();
            war3.Load("决战");
            war3.Show();
            war3.Load("决战后");
            war3.Show();

            //Console.WriteLine("*******月光宝盒*******");
            //war3 = war3List[0];
            //war3.Show();

            Console.Read();
        }
    }
}
